{include file="public/head" /}
<style>
.layui-layer-setwin a:nth-child(2),.layui-layer-setwin a:nth-child(3){
	     background: url('/static/hry/layer/skin/default/icon.png') no-repeat;
}
.layui-layer-setwin a:nth-child(2){
    background-position: -32px -40px;
}
.layui-layer-setwin a:nth-child(3){
    background-position: 1px -40px;
}
</style>
<body>
{include file="public/menu" /}
<div class="member">
    <div class="wrap">
		{include file="public/left" /}
        <div class="management">
            <div class="head commonTab">
				<div></div>
                <form action="">
                    <input type="text" name="title" placeholder="搜索项目名称" value="{:input('title')}" />
                    <input type="submit" value="搜索">
                </form>
            </div>
			<div class="bottom commonBottom">
				<table cellspacing="0" cellpadding="0" class="commonTable">
                    <tr>
                        <!--<th>项目名称</th>-->
                        <th>协议名称</th>
                        <!--<th>合同发放时间</th>-->
						<th>支持金额（元）</th>
                        <!--<th>签订时间</th>
                        <th>截止时间</th>-->
                        <th>操作</th>
                        <!--<th>操作</th>-->
                    </tr>
					{if condition="$dataList->isEmpty()"}
					<tr>
						<td colspan="5">没有数据~</td>
					</tr>
					{/if}
					{volist name="dataList" id="vo"}
					<tr>
						<!--<td>{$vo.Project.project_name}</td>-->
						<td>{$vo.title}</td>
						<!--<td>{$vo.date}</td>-->
						<td>{$vo.money}</td>
						<!--<td>{$vo.date}</td>-->
						<!--<td>{$vo.Project.end_time|date='Y-m-d H:i:s',###}</td>-->
						<td>
						<a href="JavaScript:(0)" onclick="ViewContract({$vo.id})">查看签署</a>
						<a href="JavaScript:(0)" onclick="downContract({$vo.id})">下载</a>
						</td>
					</tr>
					{/volist}
                </table>
				<div id="pages">
					{$dataList->render()}
				</div>
            </div>
        </div>
        <div class="clear"></div>
    </div>
</div>
{include file="public/foot"}
</body>
{include file="public/load_bottom" /}
<script>
	function ViewContract(id){
		var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
		$.ajax({
			url:"{:url('Order/Seecontract')}",
			type:"GET",
			dataType: "JSON",
			data:{'id':id},
			success:function(msg){
				layer.close(index);
				if(msg.status == 1){
					layer.open({
					  type: 2,
					  area: ['700px', '450px'],
					  fixed: false, //不固定
					  maxmin: true,
					  content: msg.url
					});
				}else{
					layer.alert(msg.info);
				}
			}
		})
	}
	
	/*function SignContract(id){
		layer.confirm('确认签署合同?!', {
		  btn: ['签署','稍后'] //按钮
		}, function(){
			var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
			$.ajax({
				url:"{:url('Order/signContract')}/id/"+id,
				type:"GET",
				dataType: "JSON",
				data:{},
				success:function(msg){
					layer.close(index);
					if(msg.status == 1){						
						layer.alert(msg.info,function(){							
							window.location.href=msg.url;						
						});
					}else{						
						layer.alert(msg.info);					
					}
				}
			})
		}, function(){
			layer.msg('合同签署很重要哦', {icon: 1,time:1000});
		});
	}*/
	
	function downContract(id){
		var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
		$.ajax({
			url:"{:url('Order/DownContract')}",
			type:"GET",
			dataType: "JSON",
			data:{'id':id},
			success:function(msg){
				layer.close(index);
				window.open(msg.url);

			}
		})
	}
</script>
</html>